﻿@using EC.Entity.Response.DepositOrder
@using EC.Entity.Enum

@model EC.Entity.PagedList<DepositOrderQueryResponse>
<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l wd100">商户名称</th>
                        <th class="t_l wd200">商户订单号</th>
                        <th class="t_c wd40">组</th>
                        <th class="t_l wd75">客户姓名</th>
                        <th class="t_l wd75">订单金额</th>
                        <th class="t_l wd75">支付金额</th>
                        <th class="t_l wd75">结算金额</th>
                        <th class="t_l wd75">利润金额</th>
                        <th class="t_l wd100">支付时间</th>
                        <th class="t_l" width="80">支付类型</th>
                        @*<th class="t_l" width="100">存款卡卡号</th>*@
                        <th class="t_l wd150">通知状态</th>
                        <th class="t_l wd100">最后通知时间</th>
                        <th class="t_l" width="60">通知次数</th>
                        @*<th class="t_l wd100">通知消息</th>*@
                        @*<th class="t_l">创建人</th>*@
                        <th class="t_l wd100">下单时间</th>
                        <th width="60">状态</th>
                        @*<th width="110">操作</th>*@
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (IEnumerable<DepositOrderQueryResponse>)Model.TData)
                        {
                            //更新时间之差
                            double minutes = minutes = DateTime.Now.Subtract(item.CreatedDate).TotalMinutes;
                    <tr>
                        <td class="t_l wd100">@(item.MerchantName)</td>
                        <td class="t_l wd200">
                            <span class="f_l">@(item.MerchantOrderNo)</span>
                            <span class="f_r">
                                @{
                                    if (item.NoticeStatus == (int)DepositOrderNoticeStatus.未通知 && item.Status == 1 && minutes >= 5)
                                    {
                                        <a class="btn btn-success btn-xs" data-confirm="确定要<span class=orange>补单</span>该订单？" data-succesFun="doSearch()" data-href="/DepositOrder/Success/@(item.Id)">补单</a>
                                    }
                                }
                            </span>
                        </td>
                        <td class="t_c wd40">@(item.ProxyMerchantName)</td>
                        <td class="t_c wd75">@(item.ClientCardName)</td>
                        <td class="t_r wd75">@(item.DepositAmount)</td>
                        <td class="t_r wd75 red bold">@(item.PayAmount)</td>
                        <td class="t_r wd75">@(item.JieSuanAmount)</td>
                        <td class="t_r wd75">@(item.LiRunAmount)</td>
                        <td class="t_l wd100">
                            @{
                                if (item.DepositDate.HasValue)
                                {
                                    <span>@(item.DepositDate.Value.ToString("MM-dd HH:mm:ss"))</span>
                                }
                            }
                        </td>
                        <td class="t_l" width="80">
                            @switch (item.Transtype)
                            {
                                case (sbyte)TransType.网银转账:
                                    <span>网银转账</span>
                                    break;
                                case (sbyte)TransType.支付宝转账:
                                    <span>支付宝转账</span>
                                    break;
                                case (sbyte)TransType.微信转账:
                                    <span>微信转账</span>
                                    break;
                                case (sbyte)TransType.云闪付:
                                    <span>云闪付</span>
                                    break;
                                default:
                                    <span>Unknown</span>
                                    break;
                            }
                        </td>
                        @*<td class="t_l" width="100">@(item.DepositCardNumber)</td>*@
                        <td class="t_l wd150">
                            @switch (item.NoticeStatus)
                            {
                                case 1:
                                    <span class="bold">未通知</span>
                                    break;
                                case 2:
                                    <span class="bold green">通知成功</span>
                                    break;
                                case 3:
                                    <span class="bold red" title="@(item.NoticeFail)">通知失败</span>
                                    break;
                                case 4:
                                    <span class="bold orange ">通知中</span>
                                    break;
                                case 5:
                                    <span class="bold">不通知</span>
                                    break;
                                default:
                                    break;
                            }
                            @{
                            }
                        </td>
                        <td class="t_l wd100">
                            @{
                                if (item.NoticeLastTime.HasValue)
                                {
                                    <span>@(item.NoticeLastTime.Value.ToString("MM-dd HH:mm:ss"))</span>
                                }
                            }
                        </td>
                        <td class="t_l" width="60">@(item.NoticeTimes)</td>
                        @*<td class="t_l wd100">@(item.NoticeFail)</td>*@
                        @*<td class="t_l">@(item.CreatedBy)</td>*@
                        <td class="t_l wd100">@(item.CreatedDate.ToString("MM-dd HH:mm:ss"))</td>

                        <td width="60">
                            @(item.Status == 2 ? Html.Raw("<span class='green bold'>支付成功</span>") : Html.Raw("<span class='red bold'>未支付</span>"))
                        </td>
                        @*<td width="110">
            @if (item.NoticeStatus == (sbyte)LabelStatus.启用)
            {
                <a class="btn btn-danger btn-xs" data-confirm="确定要禁用该权限？" data-succesFun="doSearch" data-href="/Label/UpdateStatus?id=@(item.Id)&status=@((sbyte)LabelStatus.禁用)">禁用</a>
            }
            else
            {
                <a class="btn btn-primary btn-xs" data-confirm="确定要启用该权限？" data-succesFun="doSearch" data-href="/Label/UpdateStatus?id=@(item.Id)&status=@((sbyte)LabelStatus.启用)">启用</a>
            }
            <button type="button" class="btn btn-default btn-xs" data-modal="/Label/AddOrEdit/@(item.Id)" data-title="编辑" data-width="452" data-height="250">
                <span class="glyphicon glyphicon-edit"></span> 编辑
            </button>
        </td>*@
                    </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="14" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />